Skip to content

Adapt to TensorKit v0.15#17

Merged
lkdvos merged 3 commits into
masterfrom
ld-0.15
Oct 6, 2025
Merged

Adapt to TensorKit v0.15#17
lkdvos merged 3 commits into
masterfrom
ld-0.15

Conversation

@lkdvos
Copy link
Copy Markdown
Member

@lkdvos lkdvos commented Oct 3, 2025

This is a minimal set of changes needed to make this package compatible with TK v0.15.

In the long run, it might be nice to consider making some more substantial changes to further reduce the required code here, while migrating some of it to MatrixAlgebraKit.
I'm listing some of these suggestions here as a reminder:

  • PolarNewton is an algorithm for computing the polar decomposition, which we can directly implement in MatrixAlgebraKit.
  • _left_polar! could be replaced with MatrixAlgebraKit.left_polar! if we adopt a strategy that is similar to the one we have for QR decompositions -- providing an empty R to indicate that we do not wish to compute R.
  • The various project(anti)hermitian functions might also be reasonable in MatrixAlgebraKit.

For now though, I'd prefer to just leave that for the future and get this merged, so also MPSKit can be updated.
Before tagging a new release, we could consider switching the formatter, and optionally migrating the repository to use the shared github actions.

@lkdvos lkdvos requested a review from Jutho October 3, 2025 20:19
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 78.12500% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.28%. Comparing base (fdc9112) to head (950fcad).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/TensorKitManifolds.jl 37.50% 5 Missing ⚠️
src/auxiliary.jl 94.11% 1 Missing ⚠️
src/unitary.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage   73.38%   74.28%   +0.89%     
==========================================
  Files           5        5              
  Lines         620      591      -29     
==========================================
- Hits          455      439      -16     
+ Misses        165      152      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/auxiliary.jl
A2 = copy(A)
Q, R = qr!(A2)
Ri = ldiv!(UpperTriangular(R)', TensorKit.MatrixAlgebra.one!(similar(R)))
Q, R = LinearAlgebra.qr!(A2)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use MAK.qr_compact! for this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for the other qr! calls below.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is the compact form that is immediately in-place multiplied into a different matrix below, so technically that's doing an additional multiplication lmul! below. I'm not sure if it really matters, but it felt a bit weird to change this into something slower if it was working before :)

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Oct 5, 2025

On this evening's flight, I will try to spend some time on TensorKitManifolds.jl, to indeed properly migrate some functionality to MatrixAlgebraKit and update it to TensorKit 0.15. Let's see where I land (hopefully Krakow, but you get the point).

@lkdvos
Copy link
Copy Markdown
Member Author

lkdvos commented Oct 6, 2025

@Jutho, do you mind if I tag and release this as a patch version already? I think this counts as non-breaking, and it is holding back MPSKit from using the new TensorKit version (and therefore also PEPSKit and TNRKit). Definitely happy to improve to more MatrixAlgebraKit implementations afterwards.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Oct 6, 2025

Ok sure.

@lkdvos lkdvos merged commit 0238f05 into master Oct 6, 2025
12 checks passed
@lkdvos lkdvos deleted the ld-0.15 branch October 6, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants